package cn.edu.hit.joinsystem.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;


@RestController
public class StaticController {

    private static List<Map> channlelist = getStaticData.getPort();
    private static List<Map<String, Object>> faultList = getStaticData.listFaults();
    private static List<Map> machineList = getStaticData.getMachines();

    @CrossOrigin
    @RequestMapping("getport")
    public List<Map> getPort(){
        return channlelist;
    }

    @CrossOrigin
    @RequestMapping(method = RequestMethod.GET, value = "faultlist", produces = "application/json;charset=UTF-8")
    public List<Map<String, Object>> listFaults() {
        return faultList;
    }

    @CrossOrigin
    @RequestMapping("getmachine")
    public List<Map> getMachine() {
        return machineList;
    }

}
